<!--
 * @Author: 谢小康 2170673706@qq.com
 * @Date: 2024-01-10 17:05:50
 * @LastEditors: 谢小康 2170673706@qq.com
 * @LastEditTime: 2024-01-30 11:21:23
 * @FilePath: \My-bolg\My_Blog\src\components\emoji.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <Transition name="fade" enter-active-class="animate__animated animate__fadeIn"
        leave-active-class="animate__animated animate__fadeOut">
        <div class="emoji" style="`font-size:$font-size-${size}`" v-if="isshow">
            <i v-for="(item, index) in emoje" :key="item" @click="getemoji(item)">
                {{ item.emoji }}
            </i>
        </div>
    </Transition>
</template>

<script setup>
import { emoje } from "@/utils/constent.js"
let props = defineProps({
    size: {
        typeof: String,
        default: 'm',
    },
    isshow: {
        typeof: Boolean,
        default: false,
    }
})
let emojilist = [];
let emits = defineEmits(['changeemoji'])
function getemoji(item) {
    let name = "[" + item.name + "]";
    emojilist.push(name);
    emits('changeemoji', emojilist);
}
</script>

<style lang="scss" scoped>
.emoji {
    padding: 8px;
    width: 100%;
    @include userTheme {
        background-color: getThemeValue(emojiColor);
    }
    i {
        margin-right: 0 2px;
        cursor: pointer;
    }
}
</style>